Skip to main content

Font Icon

Detailed Description

Font icons are a special type of font that are displayed to users as images. Font icons are vector images that can be scaled up or down as needed without losing clarity.
First, add a css file to the application.

/* .css */
@font-face {
font-family: 'icon-font';
src: url('fontIcons.eot');
src: url('fontIcons.woff2') format('woff2'),
url('fontIcons.woff') format('woff'),
url('fontIcons.ttf') format('truetype');

font-weight: normal;
font-style: normal;
}

.Icon {
font-family: "icon-font";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;

line-height: 16px;
text-align: center;
}

Then we create a button.

// .ts
const desktop = Desktop.instance();
new Button(desktop, 'Button', '&#xe321');

Let's increase the zoom level of the browser, the icon remains high-definition.